<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width"
          name="viewport">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="#2f5072">
    <meta name="format-detection" content="telephone=no">
    <meta name="description" content="">
    <title>移动平台_BBS</title>
    <link rel="stylesheet" type="text/css" href="css/style.css">

    <!-- artTemplate -->
    <script src="js/template.js"></script>
    <script src="js/jquery-2.1.3.min.js"></script>
    <script src="js/json2.js"></script>

    <script>

 function clickImgEvent(e) {
            window.android.clickImgEvent(e.attr('src'));
        }

 function setImageList() {
            //获取到所有图片的地址
            var srcList = [];
            $(".p-content img").each(
                function(){
                    var src = $(this).attr("src");
                    if(src.indexOf("bigapp:getsmile")<0){
                            srcList.push(src);
                             $(this).src='http://avatar.csdn.net/5/3/0/1_yh801216.jpg';
                    }
                }
            );
            window.android.setImages(srcList);
        }

        function setBind() {
                  $(".p-content img").bind("click",function(){
                                clickImgEvent($(this));
                             });

                        //去除表情图片的点击事件
                        $(".p-content .smile-png").unbind("click");

                        setImageList();

                        //删除引用的换行
                        $(".replyItems .reply_wrap br,.replyItems .quote br").remove();

        }

        function initWeb() {
            var article = eval("("+ window.android.getArticle() +")");
              var htmlArticle = template('tpl_article', article);
               document.getElementById('div_article').innerHTML = htmlArticle;

               setBind();
        }







    </script>

    <script id="tpl_article" type="text/html">
        <section id="portal">

            <section class="detail">
                <article>
                    <h1>{{title}}</h1>

                    <div class="detail-time"><i></i><span>{{dateline}}</span></div>
                    <div class="p-content">
                        <font face="微软雅黑">
                            <font size="3">
                                <hr class="l">
                                {{#content}}
                                </hr>
                            </font>
                        </font>

                        <div align="center"><font face="微软雅黑"><font size="3">
                            <!--http://www.mob.com/mob/img/engagement/demo05.jpg-->
                            <!-- <img src={{pic}} alt=""/>-->
                        </font>
                        </font></div>
                    </div>
                </article>
            </section>
        </section>


    </script>


</head>


<body>

<!-- main start -->
<div id="div_article">
</div>

<script language="JavaScript" type="text/javascript">
    window.onload=initWeb();



</script>
<!-- main end -->

</body>
</html>
